Field of the Invention
The present invention relates to the field of computer graphics and, in particular, to a system and method system and method for generating shadows.
Description of the Related Art
A wide variety of techniques exist for rendering shadows in a graphics scene. As with many computer graphics concepts, the goal of shadow rendering techniques is to generate shadows that appear as natural and physically accurate as possible. For example, in a real-world physical shadow, the shadow is sharp near objects that occlude the light, and become softer as the distance to the occluding object increases.
One technique for generating shadows involves ray tracing. One problem with ray tracing is that, if a “soft” ray traced shadow is called for (i.e., with blurry edges), many samples have to be used to cover a wide cone. Such an approach can quickly become very computationally expensive.
Another technique for generating shadows involves image-based shadow maps. Using this technique, shadows are created by determining whether a pixel is visible from the light source by comparing the pixel to a depth buffer of the view of the light source. This technique provides good shapes for the shadows, but the blur of shadows is unaffected by the distance to the occluding object. However, in order to achieve a lot of fine detail in shadow maps, large maps must be rendered. Also, adjusting the bias to avoid self-shadowing can be complex and time consuming.
As the foregoing illustrates, there is a need in the art for an improved technique that addresses the limitations of current approaches set forth above.